<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>CHAR_INFO</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../styles/styles.css">
<script language="javascript" src='../links.js' type="text/javascript"></script>
</head>
<body>

<h1>CHAR_INFO</h1>
<div class=navbar>
<a href="../index.html">main</a> |
<a href="../structures/index.html">structures</a> |
<a href="index.html">win32 structures</a>
</div>

<div class=shortdescr>
The <dfn>CHAR_INFO</dfn> structure specifies the Unicode or ANSI character and the colour attributes of the screen character cell. This
structure is used by console functions to read from and write to a console screen buffer.
</div>

<pre class=syntax>
typedef struct _CHAR_INFO {
  // Unicode or ANSI character
  union {
      WCHAR UnicodeChar;
      CHAR AsciiChar;
  } Char;

  // Text and background colors
  WORD Attributes;
} CHAR_INFO, *PCHAR_INFO;
</pre>

<h3>Members</h3>
<div class=descr>
    <div class=dfn>Char</div>
    <div class=dfndescr>Unicode (wide-character) or ANSI character of a screen buffer character
      cell, depending on whether it is used with the Unicode or ANSI version of a function.
    </div>

    <div class=dfn>Attributes</div>
    <div class=dfndescr>Character attributes. There are two classes of the attributes - colour and DBCS. This member can be zero or any combination of the
      following attributes: (all of them are defined in <code>Wincon.h</code>).

      <table class="cont"><tr class="cont"><th class="cont" width="40%">Attribute</th><th class="cont" width="60%">Description</th></tr>
     <tr class="cont"><td class="cont" width="40%"><a name="FOREGROUND_BLUE">FOREGROUND_BLUE</a></td>
     <td class="cont" width="60%">Text color contains blue.</td></tr>
     <tr class="cont"><td class="cont" width="40%"><a name="FOREGROUND_GREEN">FOREGROUND_GREEN</a></td>
     <td class="cont" width="60%">Text color contains green.</td></tr>
     <tr class="cont"><td class="cont" width="40%"><a name="FOREGROUND_RED">FOREGROUND_RED</a></td>
     <td class="cont" width="60%">Text color contains red.</td></tr>
     <tr class="cont"><td class="cont" width="40%"><a name="FOREGROUND_INTENSITY">FOREGROUND_INTENSITY</a></td>
     <td class="cont" width="60%">Text color is intensified.</td></tr>
     <tr class="cont"><td class="cont" width="40%"><a name="BACKGROUND_BLUE">BACKGROUND_BLUE</a></td>
     <td class="cont" width="60%">Background color contains blue.</td></tr>
     <tr class="cont"><td class="cont" width="40%"><a name="BACKGROUND_GREEN">BACKGROUND_GREEN</a></td>
     <td class="cont" width="60%">Background color contains green.</td></tr>
     <tr class="cont"><td class="cont" width="40%"><a name="BACKGROUND_RED">BACKGROUND_RED</a></td>
     <td class="cont" width="60%">Background color contains red.</td></tr>
     <tr class="cont"><td class="cont" width="40%"><a name="BACKGROUND_INTENSITY">BACKGROUND_INTENSITY</a></td>
     <td class="cont" width="60%">Background color is intensified.</td></tr>
     <tr class="cont"><td class="cont" width="40%"><a name="COMMON_LVB_LEADING_BYTE">COMMON_LVB_LEADING_BYTE</a></td>
     <td class="cont" width="60%">DBCS: Leading byte.</td></tr>
     <tr class="cont"><td class="cont" width="40%"><a name="COMMON_LVB_TRAILING_BYTE">COMMON_LVB_TRAILING_BYTE</a></td>
     <td class="cont" width="60%">DBCS: Trailing byte.</td></tr>
     <tr class="cont"><td class="cont" width="40%"><a name="COMMON_LVB_GRID_HORIZONTAL">COMMON_LVB_GRID_HORIZONTAL</a></td>
     <td class="cont" width="60%">DBCS: Grid attribute: top horizontal.</td></tr>
     <tr class="cont"><td class="cont" width="40%"><a name="COMMON_LVB_GRID_LVERTICAL">COMMON_LVB_GRID_LVERTICAL</a></td>
     <td class="cont" width="60%">DBCS: Grid attribute: left vertical.</td></tr>
     <tr class="cont"><td class="cont" width="40%"><a name="COMMON_LVB_GRID_RVERTICAL">COMMON_LVB_GRID_RVERTICAL</a></td>
     <td class="cont" width="60%">DBCS: Grid attribute: right vertical.</td></tr>
     <tr class="cont"><td class="cont" width="40%"><a name="COMMON_LVB_REVERSE_VIDEO">COMMON_LVB_REVERSE_VIDEO</a></td>
     <td class="cont" width="60%">DBCS: Reverse foreground and background attributes.</td></tr>
     <tr class="cont"><td class="cont" width="40%"><a name="COMMON_LVB_UNDERSCORE">COMMON_LVB_UNDERSCORE</a></td>
     <td class="cont" width="60%">DBCS: Underscore.</td></tr>
     </table>
        The foreground attributes  (FOREGROUND_*) define the colour of the text symbols. The background attributes (BACKGROUND_*) define the colour of the background of the text cell. Other attributes (COMMON_LVB_*) are used with <strong><span title="Double-byte Character Sets">DBCS</span></strong>.
  </div>

</div>

<h3>Remarks</h3>
<div class=descr>
</div>

<div class=see>See also:</div><div class=seecont>
<a href="win32/ReadConsoleOutput">ReadConsoleOutput</a>,
<a href="win32/ScrollConsoleScreenBuffer">ScrollConsoleScreenBuffer</a>,
<a href="win32/WriteConsoleOutput">WriteConsoleOutput</a>
</div>

</body>
</html>
